package logic;

import java.util.ArrayList;
import java.util.HashMap;

public class MushroomInfo {
    public static final String INFO = "Mushroom Dataset";
    
    public static final String[] ATTRIBUTE_NAMES = {
        "cap-shape", "cap-surface", "cap-color",
        "bruises", "odor",
        "gill-attachment", "gill-spacing", "gill-size", "gill-color",
        "stalk-shape", "stalk-root",
        "stalk-surface-above-ring", "stalk-surface-below-ring",
        "stalk-color-above-ring", "stalk-color-below-ring",
        "veil-type", "veil-color",
        "ring-number", "ring-type",
        "spore-print-color", "population", "habitat", "class"
    };
    
    public static final int NUM_ATTRIBUTES = ATTRIBUTE_NAMES.length; 
    
    public static final int CLASS_IDX = NUM_ATTRIBUTES - 1;
    
    public static final char[][] ATTRIBUTE_VALUES_SHORT = {
        {'x', 'b', 's', 'f', 'k', 'c'},                                 // cap-shape
        {'s', 'y', 'f', 'g'},                                           // cap-surface
        {'n', 'y', 'w', 'g', 'e', 'p', 'b', 'u', 'c', 'r'},             // cap-color
        {'t', 'f'},                                                     // bruises
        {'p', 'a', 'l', 'n', 'f', 'c', 'y', 's', 'm'},                  // odor
        {'f', 'a', 'd', 'n'},                                           // gill-attachment
        {'c', 'w', 'd'},                                                // gill-spacing
        {'n', 'b'},                                                     // gill-size
        {'k', 'n', 'g', 'p', 'w', 'h', 'u', 'e', 'b', 'r', 'y', 'o'},   // gill-color
        {'e', 't'},                                                     // stalk-shape
        {'e', 'c' , 'b', 'r', 'u', 'z', '?'},                           // stalk-root
        {'s', 'f', 'k', 'y'},                                           // stalk-surace-above-ring
        {'s', 'f', 'y', 'k'},                                           // stalk-surface-below-ring
        {'w', 'g', 'p', 'n', 'b', 'e', 'o', 'c', 'y'},                  // stalk-color-above-ring
        {'w', 'p', 'g', 'b', 'n', 'e', 'y', 'o', 'c'},                  // stalk-color-below-ring
        {'p', 'u'},                                                     // veil-type
        {'w', 'n', 'o', 'y'},                                           // veil-color
        {'o', 't', 'n'},                                                // ring-number
        {'p', 'e', 'l', 'f', 'n', 'c', 's', 'z'},                       // ring-type
        {'k', 'n', 'u', 'h', 'w', 'r', 'o', 'y', 'b'},                  // spore-print-color
        {'s', 'n', 'a', 'v', 'y', 'c'},                                 // population
        {'u', 'g', 'm', 'd', 'p', 'w', 'l'},                            // habitat
        {'p', 'e'}                                                      // class
    };
    
    public static final char[] CLASS_VALUES_SHORT = {'p', 'e'};
    public static final String[] CLASS_VALUES_LONG = {"poisonous", "edible"};
    
    public HashMap<String, Integer> ATTRIBUTE_INDEX = new HashMap<String, Integer>();
    
    
    public ArrayList<HashMap<Character, String>> ATTRIBUTE_VALUES_LONG
            = new ArrayList<HashMap<Character, String>>();
    
    public MushroomInfo() {
        HashMap<Character, String> hash0 = new HashMap<Character, String>();
        hash0.put('b', "bell");
        hash0.put('c', "conical");
        hash0.put('x', "convex");
        hash0.put('f', "flat");
        hash0.put('k', "knobbed");
        hash0.put('s', "sunken");
        ATTRIBUTE_VALUES_LONG.add(hash0);
        
        HashMap<Character, String> hash1 = new HashMap<Character, String>();
        hash1.put('f', "fibrous");
        hash1.put('g', "grooves");
        hash1.put('y', "scaly");
        hash1.put('s', "smooth");
        ATTRIBUTE_VALUES_LONG.add(hash1);
        
        HashMap<Character, String> hash2 = new HashMap<Character, String>();
        hash2.put('n', "brown");
        hash2.put('b', "buff");
        hash2.put('c', "cinnamon");
        hash2.put('g', "gray");
        hash2.put('r', "green");
        hash2.put('p', "pink");
        hash2.put('u', "purple");
        hash2.put('e', "red");
        hash2.put('w', "white");
        hash2.put('y', "yellow");
        ATTRIBUTE_VALUES_LONG.add(hash2);
        
        HashMap<Character, String> hash3 = new HashMap<Character, String>();
        hash3.put('t', "bruises");
        hash3.put('f', "no");
        ATTRIBUTE_VALUES_LONG.add(hash3);
        
        HashMap<Character, String> hash4 = new HashMap<Character, String>();
        hash4.put('a', "almond");
        hash4.put('l', "anise");
        hash4.put('c', "creosote");
        hash4.put('y', "fishy");
        hash4.put('f', "foul");
        hash4.put('m', "musty");
        hash4.put('n', "none");
        hash4.put('p', "pungent");
        hash4.put('s', "spicy");
        ATTRIBUTE_VALUES_LONG.add(hash4);
        
        HashMap<Character, String> hash5 = new HashMap<Character, String>();
        hash5.put('a', "attached");
        hash5.put('d', "descending");
        hash5.put('f', "free");
        hash5.put('n', "notched");
        ATTRIBUTE_VALUES_LONG.add(hash5);
        
        HashMap<Character, String> hash6 = new HashMap<Character, String>();
        hash6.put('c', "close");
        hash6.put('w', "crowded");
        hash6.put('d', "distant");
        ATTRIBUTE_VALUES_LONG.add(hash6);
        
        HashMap<Character, String> hash7 = new HashMap<Character, String>();
        hash7.put('b', "broad");
        hash7.put('n', "narrow");
        ATTRIBUTE_VALUES_LONG.add(hash7);
        
        HashMap<Character, String> hash8 = new HashMap<Character, String>();
        hash8.put('k', "black");
        hash8.put('n', "brown");
        hash8.put('b', "buff");
        hash8.put('h', "chocolate");
        hash8.put('g', "gray");
        hash8.put('r', "green");
        hash8.put('o', "orange");
        hash8.put('p', "pink");
        hash8.put('u', "purple");
        hash8.put('e', "red");
        hash8.put('w', "white");
        hash8.put('y', "yellow");
        ATTRIBUTE_VALUES_LONG.add(hash8);
        
        HashMap<Character, String> hash9 = new HashMap<Character, String>();
        hash9.put('e', "enlarging");
        hash9.put('t', "tapering");
        ATTRIBUTE_VALUES_LONG.add(hash9);
        
        HashMap<Character, String> hash10 = new HashMap<Character, String>();
        hash10.put('b', "bulbous");
        hash10.put('c', "club");
        hash10.put('u', "cup");
        hash10.put('e', "equal");
        hash10.put('z', "rhizomorphs");
        hash10.put('r', "rooted");
        hash10.put('?', "missing");
        ATTRIBUTE_VALUES_LONG.add(hash10);
        
        HashMap<Character, String> hash11 = new HashMap<Character, String>();
        hash11.put('f', "fibrous");
        hash11.put('y', "scaly");
        hash11.put('k', "silky");
        hash11.put('s', "smooth");
        ATTRIBUTE_VALUES_LONG.add(hash11);
        
        HashMap<Character, String> hash12 = new HashMap<Character, String>();
        hash12.put('f', "fibrous");
        hash12.put('y', "scaly");
        hash12.put('k', "silky");
        hash12.put('s', "smooth");
        ATTRIBUTE_VALUES_LONG.add(hash12);
        
        HashMap<Character, String> hash13 = new HashMap<Character, String>();
        hash13.put('n', "brown");
        hash13.put('b', "buff");
        hash13.put('c', "cinnamon");
        hash13.put('g', "gray");
        hash13.put('o', "orange");
        hash13.put('p', "pink");
        hash13.put('e', "red");
        hash13.put('w', "white");
        hash13.put('y', "yellow");
        ATTRIBUTE_VALUES_LONG.add(hash13);
        
        HashMap<Character, String> hash14 = new HashMap<Character, String>();
        hash14.put('n', "brown");
        hash14.put('b', "buff");
        hash14.put('c', "cinnamon");
        hash14.put('g', "gray");
        hash14.put('o', "orange");
        hash14.put('p', "pink");
        hash14.put('e', "red");
        hash14.put('w', "white");
        hash14.put('y', "yellow");
        ATTRIBUTE_VALUES_LONG.add(hash14);
        
        HashMap<Character, String> hash15 = new HashMap<Character, String>();
        hash15.put('p', "partial");
        hash15.put('u', "universal");
        ATTRIBUTE_VALUES_LONG.add(hash15);
        
        HashMap<Character, String> hash16 = new HashMap<Character, String>();
        hash16.put('n', "brown");
        hash16.put('o', "orange");
        hash16.put('w', "white");
        hash16.put('y', "yellow");
        ATTRIBUTE_VALUES_LONG.add(hash16);
        
        HashMap<Character, String> hash17 = new HashMap<Character, String>();
        hash17.put('n', "none");
        hash17.put('o', "one");
        hash17.put('t', "two");
        ATTRIBUTE_VALUES_LONG.add(hash17);
        
        HashMap<Character, String> hash18 = new HashMap<Character, String>();
        hash18.put('c', "cobwebby");
        hash18.put('e', "evanescent");
        hash18.put('f', "flaring");
        hash18.put('l', "large");
        hash18.put('n', "none");
        hash18.put('p', "pendant");
        hash18.put('s', "sheathing");
        hash18.put('z', "zone");
        ATTRIBUTE_VALUES_LONG.add(hash18);
        
        HashMap<Character, String> hash19 = new HashMap<Character, String>();
        hash19.put('k', "black");
        hash19.put('n', "brown");
        hash19.put('b', "buff");
        hash19.put('h', "chocolate");
        hash19.put('r', "green");
        hash19.put('o', "orange");
        hash19.put('u', "purple");
        hash19.put('w', "white");
        hash19.put('y', "yellow");
        ATTRIBUTE_VALUES_LONG.add(hash19);
        
        HashMap<Character, String> hash20 = new HashMap<Character, String>();
        hash20.put('a', "abundant");
        hash20.put('c', "clustered");
        hash20.put('n', "numerous");
        hash20.put('s', "scattered");
        hash20.put('v', "several");
        hash20.put('y', "solitary");
        ATTRIBUTE_VALUES_LONG.add(hash20);
        
        HashMap<Character, String> hash21 = new HashMap<Character, String>();
        hash21.put('g', "grasses");
        hash21.put('l', "leaves");
        hash21.put('m', "meadows");
        hash21.put('p', "paths");
        hash21.put('u', "urban");
        hash21.put('w', "waste");
        hash21.put('d', "woods");
        ATTRIBUTE_VALUES_LONG.add(hash21);
        
        HashMap<Character, String> hash22 = new HashMap<Character, String>();
        hash22.put('e', "edible");
        hash22.put('p', "poisonous");
        ATTRIBUTE_VALUES_LONG.add(hash22);
        
        for (int i = 0; i < NUM_ATTRIBUTES; i++) {
            ATTRIBUTE_INDEX.put(ATTRIBUTE_NAMES[i], i);
        }
    }
    
    public static MushroomInfo singleton = new MushroomInfo();
}
